﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace LbangCMS
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
               name: "index",
               url: "index.html",
               defaults: new { controller = "Home", action = "Index" },
               constraints: null,
               namespaces: new string[] { "LbangCMS.Controllers" }
           );
            routes.MapRoute(
               name: "404",
               url: "404.html",
               defaults: new { controller = "Home", action = "NotFound" },
               constraints: null,
               namespaces: new string[] { "LbangCMS.Controllers" }
           );
            routes.MapRoute(
                name: "staticPage",
                url: "static/{code}.html",
                defaults: new { controller = "Home", action = "SinglePage", code = UrlParameter.Optional },
                constraints: null,
                namespaces: new string[] { "LbangCMS.Controllers" }
            );
            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
                constraints:null,
                namespaces: new string[] { "LbangCMS.Controllers" }
            );
        }
    }
}
